import request from "@/utils/request";

export const workOrderManagement = {
  contextPath: '/defects', //按照实际应用修改成微服务的名�?//
  getdata: (data) => { //分页查询
    return request({
      url: workOrderManagement.contextPath + '/en-defects-sheet/page',
      method: 'POST',
      data: data
    })
  },
  updateData: (data) => { //修改，删除
    return request({
      url: workOrderManagement.contextPath + '/t-en-stock-task/update',
      method: 'POST',
      data: data
    })
  },
  sendOrder: (data) => { //派单
    return request({
      url: workOrderManagement.contextPath + '/en-defects-sheet/pdSend',
      method: 'POST',
      data: data
    })
  },

  getTaskOperateList: (code) => { //获取操作节点
    return request({
      url: '/equip' + '/t-en-stock-task/getTaskProcess/' + code,
      method: 'POST',
      // data: data
    })
  },
  getTaskOperateList2: (code) => { //获取操作节点
    return request({
      url: workOrderManagement.contextPath + '/en-defects-sheet/getProcessList?sheet_id=' + code,
      method: 'POST',
      // data: data
    })
  },
  getTaskEquipList: (sheet_id) => { //根据任务编码获取设备列表
    return request({
      url: workOrderManagement.contextPath + '/en-defects-sheet/getBySheetId?sheet_id=' + sheet_id,
      method: 'POST',
    })
  },
  exportXls: (data) => { //导出//
    return request({
      url: workOrderManagement.contextPath + '/en-defects-sheet/export/excel',
      method: 'POST',
      data: data,
      responseType: 'blob'
    })
  },
  getById: (id) => { //getById消缺工单表
    return request({
      url: workOrderManagement.contextPath + '/en-defects-sheet/' + id,
      method: 'POST',
    })
  },
  getZlpjSend: (data) => {
    return request({
      url: workOrderManagement.contextPath + '/en-defects-sheet/zlpjSend',
      method: 'POST',
      data: data
    })
  },
  //人员轨迹
  gettrackList: (data) => {
    return request({
      // url: workOrderManagement.contextPath + '/en-patrol-task/energyPtgis'+data.endTime +data.startTime +data.yhid,
      url: workOrderManagement.contextPath + '/en-defects-sheet/energyPtgis?endTime=' + data.endTime + '&startTime=' + data.startTime + '&yhid=' + data.yhid,

      method: 'POST',
      // data:data
    })
  },

}
